n=2;
X=zeros((n+1)*(3*n+1)*3,1);
Y=zeros((n+1)*(3*n+1)*3,1);
Z=zeros((n+1)*(3*n+1)*3,1);
S=zeros((n+1)*(3*n+1)*3,1);
C=zeros((n+1)*(3*n+1)*3,3);
for k = -3*n/2:3*n/2
    for l = -n/2:n/2
        fprintf(1,'( %g , %g ,%g) ',-2*l*k/n,k,k);
        Y((l+n/2+1)+(n+1)*(k+3*n/2))=-2*l*k/n;
        Z((l+n/2+1)+(n+1)*(k+3*n/2))=k;
        X((l+n/2+1)+(n+1)*(k+3*n/2))=k;
        S((l+n/2+1)+(n+1)*(k+3*n/2))=35+20*sign(k);
        C((l+n/2+1)+(n+1)*(k+3*n/2),:)=[0 0 1];
    end
    fprintf(1,'\n');
end
fprintf(1,'\n');
for k = -3*n/2:3*n/2
    for l = -n/2:n/2
        fprintf(1,'( %g , %g ,%g) ',-2*l*k/n,k,k);
        X((n+1)*(3*n+1)+(l+n/2+1)+(n+1)*(k+3*n/2))=2*l*k/n;
        Z((n+1)*(3*n+1)+(l+n/2+1)+(n+1)*(k+3*n/2))=-k;
        Y((n+1)*(3*n+1)+(l+n/2+1)+(n+1)*(k+3*n/2))=-k;
        S((n+1)*(3*n+1)+(l+n/2+1)+(n+1)*(k+3*n/2))=35+20*sign(k);
        C((n+1)*(3*n+1)+(l+n/2+1)+(n+1)*(k+3*n/2),:)=[0 1 0];
    end
    fprintf(1,'\n');
end
fprintf(1,'\n');
for k = -3*n/2:3*n/2
    for l = -n/2:n/2
        fprintf(1,'( %g , %g ,%g) ',-2*l*k/n,k,k);
        Z(2*(n+1)*(3*n+1)+(l+n/2+1)+(n+1)*(k+3*n/2))=-2*l*k/n;
        Y(2*(n+1)*(3*n+1)+(l+n/2+1)+(n+1)*(k+3*n/2))=k;
        X(2*(n+1)*(3*n+1)+(l+n/2+1)+(n+1)*(k+3*n/2))=k;
        S(2*(n+1)*(3*n+1)+(l+n/2+1)+(n+1)*(k+3*n/2))=35+20*sign(k);
        C(2*(n+1)*(3*n+1)+(l+n/2+1)+(n+1)*(k+3*n/2),:)=[1 0 0];
    end
    fprintf(1,'\n');
end

scatter3(X,Y,Z,S,C,'filled')
%axis off